package cn.yanlin.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author zhangyanlin
 * @version 1.0
 * @date 2021/10/8 20:57
 */
@Configuration
public class ApplicationContextConfig {
    @Bean
    @LoadBalanced//赋予restTemplate负载均衡能力
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
